﻿<UserControl x:Class="Studio.DocumentDB.ToolBarUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d">
    <UserControl.Resources>
        <Style TargetType="ToolBar">
            <Setter Property="Background" Value="Transparent"/>
        </Style>
    </UserControl.Resources>
    <ToolBarTray Background="{StaticResource toolBarColour}">
        <ToolBar Band="1">
            <Button Click="Connect_Click">
                <StackPanel Orientation="Horizontal">
                    <Image Source="Images/Connect.png"/>
                    <Label>Connect</Label>
                </StackPanel>
            </Button>
            <Separator/>
            <Button Click="Refresh_Click">
                <Button.Style>
                    <Style TargetType="FrameworkElement">
                        <Setter Property="IsEnabled" Value="False"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=Accounts.IsRefreshableSelected}" Value="true">
                                <Setter Property="IsEnabled" Value="True"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
                <StackPanel Orientation="Horizontal">
                    <Image Source="Images/refresh.png"/>
                    <Label>Refresh</Label>
                </StackPanel>
            </Button>
            <Button Click="NewDB_Click">
                <Button.Style>
                    <Style TargetType="FrameworkElement">
                        <Setter Property="IsEnabled" Value="False"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=Accounts.IsDatabaseFolderSelected}" Value="true">
                                <Setter Property="IsEnabled" Value="True"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
                <StackPanel Orientation="Horizontal">
                    <Image Source="Images/db.png"/>
                    <Label>New DB</Label>
                </StackPanel>
            </Button>
            <Button Click="RemoveDB_Click">
                <Button.Style>
                    <Style TargetType="FrameworkElement">
                        <Setter Property="IsEnabled" Value="False"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=Accounts.IsDatabaseSelected}" Value="true">
                                <Setter Property="IsEnabled" Value="True"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
                <StackPanel Orientation="Horizontal">
                    <Image Source="Images/Recycle-Bin.png"/>
                    <Label>Remove DB</Label>
                </StackPanel>
            </Button>
            <Button Click="NewCollection_Click">
                <Button.Style>
                    <Style TargetType="FrameworkElement">
                        <Setter Property="IsEnabled" Value="False"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=Accounts.IsCollectionFolderSelected}" Value="true">
                                <Setter Property="IsEnabled" Value="True"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
                <StackPanel Orientation="Horizontal">
                    <Image Source="Images/Collection.png"/>
                    <Label>New Collection</Label>
                </StackPanel>
            </Button>
            <Button Click="RemoveCollection_Click">
                <Button.Style>
                    <Style TargetType="FrameworkElement">
                        <Setter Property="IsEnabled" Value="False"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=Accounts.IsCollectionSelected}" Value="true">
                                <Setter Property="IsEnabled" Value="True"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
                <StackPanel Orientation="Horizontal">
                    <Image Source="Images/Recycle-Bin.png"/>
                    <Label>Remove Collection</Label>
                </StackPanel>
            </Button>
        </ToolBar>
    </ToolBarTray>
</UserControl>
